﻿@model HotelManageSystem.Domain.Entities.Godownentry

@{
    ViewBag.Title = "修改入库单";
    Layout = "~/Views/Shared/_LayoutWarehouse.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="editGo" style="width: 100%;height: 100%">
    @using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <table>
            <ul>
                <tr>
                    <td>  @Html.HiddenFor(model => model.ID)
                        @Html.HiddenFor(model => model.GodownentryID)
                    </td>
                </tr>
                <tr>
                    <td>
                        <h3>
                            货品名:
                        </h3>
                    </td>
                    <td>
                        @Html.DropDownList("productName")
                    </td>
                </tr>
                <tr>
                    <td><h3>提供商:</h3></td>
                    <td> @Html.DropDownList("productProvider")</td>
                </tr>
                <tr>
                    <td><h3>入库单价:</h3></td>
                    <td> @Html.TextBox("textprice")</td>
                </tr>
                <tr>
                    <td><h3>入库数量:</h3></td>
                    <td> @Html.TextBox("textcount")</td>
                    <td>
                        @*总计： @Html.Raw("<input id='texttotal' value='" + ViewData["texttotal"] +"' disabled='false'/>")*@
                        <div id="total">
                           @Html.TextBox("texttotal")
                        </div>
                    </td>
                </tr>
                <tr>
                    <td><h3>入库时间:</h3></td>
                    <td>
                        @Html.EditorFor(model => model.Datetime)
                        @Html.ValidationMessageFor(model => model.Datetime)
                    </td>
                </tr>
                <tr>
                    <td><h3>审核人:</h3></td>
                    <td>
                        @Html.EditorFor(model => model.Billproducer)
                        @Html.ValidationMessageFor(model => model.Billproducer)
                    </td>
                </tr>
                <tr>
                    <td><h3>存放仓库:</h3></td>
                    <td>@Html.DropDownList("warehouse")</td>
                </tr>
                <tr>
                    <td><h3>制单人:</h3></td>
                    <td>@Html.DropDownList("employee")</td>
                </tr>
                    <tr>
                    <td><input type="submit" value="创建" /></td>
                    <td><td> @Html.ActionLink("返回", "Index")</td></td>
                </tr>
            </ul>
        </table>     

    </fieldset>
}
</div>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script type="text/javascript" >
    $(document).ready(function () {
        $(".field").change(function () {
            $(this).css("background-color", "#FFFFCC");
        });
        $("#textcount").keyup(function () {
            var price = $("#textprice").attr("value");
            var count = $("#textcount").attr("value");

            $("#texttotal").val(price * count);
        }
        );
        $("#textprice").keyup(function () {
            var price = $("#textprice").attr("value");
            var count = $("#textcount").attr("value");

            $("#texttotal").val(price * count);
        }
        );
        $("#total").hide();
    });
   
   
</script>